import request from '@/utils/request'

export function listCharge(query) {
  return request({
    url: '/charge/list',
    method: 'get',
    params: query
  })
}

export function listCdkeys(companyId, chargeId) {
  return request({
    url: '/cdkey/export',
    method: 'get',
    params: {
      companyId: companyId,
      chargeId: chargeId
    }
  })
}
export function deleteCharge(data) {
  return request({
    url: '/charge/delete',
    method: 'post',
    data
  })
}

export function createCharge(data) {
  return request({
    url: '/charge/create',
    method: 'post',
    data
  })
}

export function readCharge(query) {
  return request({
    url: '/charge/read',
    method: 'get',
    params: query
  })
}

export function editCharge(data) {
  return request({
    url: '/charge/update',
    method: 'post',
    data
  })
}
